import request from "@/utils/request";

//查看SKU列表 GET /admin/product/findBySpuId/{spuId}
export function getSkuListApi(spuId) {
  return request({
    url: `/admin/product/findBySpuId/${spuId}`,
    method: "get"
  });
}
//添加Sku POST /admin/product/saveSkuInfo
export function saveSkuInfoApi(data) {
  return request({
    url: `/admin/product/saveSkuInfo`,
    method: "post",
    data
  });
}
//删除SPU DELETE /admin/product/deleteSpu/{spuId}
export function removeSpuApi(spuId) {
  return request({
    url: `/admin/product/deleteSpu/${spuId}`,
    method: "delete"
  });
}
//更新时获取图片列表 GET /admin/product/spuImageList/{spuId}
export function spuImgListApi(spuId) {
  return request({
    url: `/admin/product/spuImageList/${spuId}`,
    method: "get"
  });
}
//更新时获取销售属性列表 GET /admin/product/spuSaleAttrList/{spuId}
export function spuSaleAttrListApi(spuId) {
  return request({
    url: `/admin/product/spuSaleAttrList/${spuId}`,
    method: "get"
  });
}
//更新Spu POST /admin/product/updateSpuInfo
export function getUpdateSpuApi(data) {
  return request({
    url: `/admin/product/updateSpuInfo`,
    method: "post",
    data
  });
}
//添加spu POST /admin/product/saveSpuInfo
export function getAddSpuApi(data) {
  return request({
    url: `/admin/product/saveSpuInfo`,
    method: "post",
    data
  });
}
//获取spu品牌GET /admin/product/baseTrademark/getTrademarkList
export function getSpuTrademarkListApi() {
  return request({
    url: `/admin/product/baseTrademark/getTrademarkList`,
    method: "get",
  });
}
//获取销售属性GET /admin/product/baseSaleAttrList
export function getSaleAttrListApi() {
  return request({
    url: `/admin/product/baseSaleAttrList`,
    method: "get",
  });
}
//获取Spu列表GET /admin/product/{page}/{limit}
export function getSpuListApi(page, limit, category3Id) {
  return request({
    url: `/admin/product/${page}/${limit}`,
    method: "get",
    params: {
      category3Id,
    },
  });
}
